import { useLocalStorage } from "@vueuse/core"
import { useOsTheme } from "naive-ui"
import { computed } from "vue"

export function useThemeVar(dark: any, light: any) {
  const mode = useLocalStorage("theme", "auto")
  const osTheme = useOsTheme()
  return computed(() => {
    if (mode.value === "light") {
      return light
    } else if (mode.value === "dark") {
      return dark
    } else {
      return osTheme.value === "dark" ? dark : light
    }
  })
}
